package com.ty.day2;

/**
 * Created by IntelliJ IDEA.
 *
 * @author : txy
 * @create : 2023/11/15 16:36
 */
public class Demo02 {
    public static void main(String[] args) {
        B b = new B();
//        B b1 = new B(2);
    }

}
class A{
    int x;

    public A() {
        System.out.println("a无参");
    }

    public A(int x) {
        this.x = x;
        System.out.println("a有参");
    }
}
class B extends A {
    int y;

    public B() {

        System.out.println("b无参");
    }

    public B(int y) {
        super(y);
        this.y = y;
        System.out.println("b有参");
    }
}
